export const TeacherAllNum = [2, 32, 64]

// 是否属于这门课程的任课教师
export function TeacherOfTheCourse(item, userInfo) {
  if (item.tutorStaffUserID === userInfo.userID) {
    return true;
  }
  if (!item.tutorIDToClassIDMap) return false;
  const IDMap = item.tutorIDToClassIDMap?.split(";");
  const findMe = IDMap?.find(
    (IDitem) => IDitem && IDitem.split(":")[0] == userInfo.userID
  );
  if (findMe) return true
  else return false
}

// 用户是否属于这门课程的设计师
export function UserOfTheCourseDesigner(item, userInfo) {
  if (item?.mainDesignerUserID == userInfo.userID) return true
  if (item.otherDesigerUserIDList) {
    return item.otherDesigerUserIDList?.split(",").some(sitem => sitem == userInfo.userID)
  }
  return false
}

export default {
  TeacherOfTheCourse
}